import mongoose from 'mongoose';
import BaseModel from './base_model';

const Schema = mongoose.Schema;
const ObjectId = Schema.ObjectId;

const AudioSchema = new Schema({
  appId: { type: String, required: true },
  type: { type: String, required: true },
  title: { type: String, required: true },
  describe: { type: String, required: true },
  url: { type: String, required: true },
  create_at: { type: Date, default: Date.now },
});
AudioSchema.plugin(BaseModel);
AudioSchema.index({ create_at: -1 });

mongoose.model('Audio', AudioSchema);
